drivers: improve error message when executor process crashes#27783
Open
tmchow wants to merge 1 commit intohashicorp:mainfrom
Open
drivers: improve error message when executor process crashes#27783tmchow wants to merge 1 commit intohashicorp:mainfrom
tmchow wants to merge 1 commit intohashicorp:mainfrom
Conversation
When the executor process terminates unexpectedly (e.g. OOM killed), the task event shows a raw gRPC error like "rpc error: code = Unavailable desc = error reading from server: read tcp ...". This is confusing because operators see an internal RPC error instead of a clear indication that the executor crashed. This changes the error message to "executor: the executor process terminated unexpectedly" when the process state is nil (which indicates the executor died before reporting exit status). The original error is still included for debugging. When process state IS available, the original message is preserved. Applied consistently to all four task drivers: exec, rawexec, java, and qemu. Fixes hashicorp#24220
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When the executor process terminates unexpectedly (OOM killed, crash, etc.), the task event shows a raw gRPC error that's confusing for operators. This changes the error message to clearly indicate the executor crashed.
Changes
Updated
handleWaitin all four task drivers (exec,rawexec,java,qemu) to provide different error messages depending on whether the executor process returned a process state:Before:
After:
The raw error is still included for debugging, but the prefix now tells operators what actually happened instead of exposing internal RPC details as the primary message.
Testing
The logic change is a conditional branch on the existing
ps == nilcheck (which was already there for setting exit code). The error wrapping is unchanged, just the message prefix when the executor is confirmed dead.Fixes #24220
This contribution was developed with AI assistance (Claude Code).